/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.integration;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import model.dto.RoleDTO;

/**
 *
 * @author Ahmed Salem
 */
@Entity
@Table(name = "role", catalog = "greenland", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Role.findAll", query = "SELECT r FROM Role r"),
    @NamedQuery(name = "Role.findByRoleId", query = "SELECT r FROM Role r WHERE r.roleId = :roleId"),
    @NamedQuery(name = "Role.findByName", query = "SELECT r FROM Role r WHERE r.name = :name")})
public class Role implements Serializable, RoleDTO {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "role_id")
    private Integer roleId;
    @Size(max = 45)
    @Column(name = "name")
    private String name;

    /**
     *
     */
    public Role() {
    }

    /**
     *
     * @param roleId
     * @param name
     */
    public Role(Integer roleId, String name){
        this.roleId = roleId;
        this.name = name;
    }

   //******** All the set methods of the role class ****/ 
    /**
     *
     * @param roleId
     */
    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

     /**
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    } //******** The end of the set methods *** / 

   
    //********* All the get methods of the role class ****/
    /**
     *
     * @return
     */
    @Override
    public Integer getRoleId() {
        return roleId;
    }
    /**
     *
     * @return
     */
    @Override
    public String getName() {
        return name;
    }
  //***** The end of get Methods ***//

   

   
   
    
}
